//------------------------------------------------------------------------
/*
	Author:	Philipp Hannemann
	Date:	01.11.2012
	Beschreibung:
		Eine abstrake Klasse, die die Steuerung abkapseln wird.
		
*/
//------------------------------------------------------------------------
#ifndef ControllInterface_h_
#define ControllInterface_h_ ControllInterface_h_
//------------------------------------------------------------------------
// Includes
//------------------------------------------------------------------------
#include "IrrlichtHeader.h"
#include "Misc.h"
#include "InputEventReceiver.h"
#include "wiiuse.h"
//------------------------------------------------------------------------
// Macros
//------------------------------------------------------------------------
#define ControlInterfaceChanged 1 // set not equal 0 if interface changed
//------------------------------------------------------------------------
// Misc
//------------------------------------------------------------------------

//------------------------------------------------------------------------
class ControlInterface
{
public:
	// Camera Movement
	virtual bool pitchCameraUp() const = 0;
	virtual bool pitchCameraDown() const = 0;
	virtual bool yawCameraRight() const = 0;
	virtual bool yawCameraLeft() const = 0;

public:
	// Object Movement
	virtual bool rollObjectRight() const = 0; // um z-Achse, bzw XY Ebene
	virtual bool rollObjectLeft() const = 0;
	virtual bool pitchObjectFront() const = 0; // um x-Achse, bzw YZ Ebene
	virtual bool pitchObjectBack() const = 0;
	virtual bool yawObjectLeft() const = 0; // um y-Achse, XZ-Ebene
	virtual bool yawObjectRight() const = 0;

public:
	// cursor and Selection
	virtual vector2df const& moveCursor() const = 0;
	virtual vector2di getCursorPosition() const = 0;
	virtual bool toggleSelection() const = 0;

public:
	virtual void poll(void) = 0;

protected:
	static const float MAX_MOVEMENT_DISTANCE;
};
//------------------------------------------------------------------------
class DummyControlling : public ControlInterface, public virtual Entity
{
public:
	DummyControlling(IrrlichtDevice * const dev);
	~DummyControlling(void);

	virtual bool pitchCameraUp() const;
	virtual bool pitchCameraDown() const;

	virtual bool yawCameraRight() const;
	virtual bool yawCameraLeft() const;

	virtual bool rollObjectRight() const;
	virtual bool rollObjectLeft() const;
	virtual bool pitchObjectFront() const;
	virtual bool pitchObjectBack() const;
	virtual bool yawObjectLeft() const;
	virtual bool yawObjectRight() const;

public:
	virtual vector2df const& moveCursor() const;
	virtual vector2di getCursorPosition() const;
	virtual bool toggleSelection() const;

public:
	virtual void poll(void);

private:
	InputEventReceiver m_evtReceiver;
	
	vector2df m_dPos;
	vector2di m_cursorPosition;
};
//------------------------------------------------------------------------
#endif // ControllInterface_h_
